package com.sportswork.sportswork.core.service.impl;

import com.sportswork.sportswork.core.entity.Classroom;
import com.sportswork.sportswork.core.mapper.ClassMapper;
import com.sportswork.sportswork.core.mapper.CreditMapper;
import com.sportswork.sportswork.core.service.IClassService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author dengwei
 * @date 2020/2/3 12:02
 * @description
 */
@Slf4j
@Service
@Transactional
public class ClassServiceImp implements IClassService {

    @Resource
    private ClassMapper classMapper;

    @Override
    public Classroom addClassroom(Classroom classroom) {
        classMapper.addClassroom(classroom);
        return classroom;
    }

    @Override
    public Classroom getClassroom(String id) {
        return classMapper.getClassroom(id);
    }



    @Override
    public Classroom getClassroomByNumber(String number) {
        return classMapper.getClassroomByNumber(number);
    }

    @Override
    public List<Classroom> getAllClassrooms(String number, String name,String xsid) {
        return classMapper.getAllClassrooms(number,name,xsid);
    }

    @Override
    public void deleteClassroom(String id) {
        classMapper.deleteClassroom(id);
    }

    @Override
    public void deleteClassrooms(String ids) {
        classMapper.deleteClassrooms(ids);
    }

    @Override
    public Classroom setClassroom(Classroom classroom) {
        classMapper.setClassroom(classroom);
        return classroom;
    }
}
